package com.spring.task.job;

 

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


 

 

@Component
public class GoodsJob {
	private final Logger logger = LoggerFactory.getLogger(GoodsJob.class);
    
    
    private static boolean isSynchFlag=true;
 
    
    
    @Scheduled(cron = "${goodsFlag.syn.cron}")
    public void goodsFlagSynch() {
    	logger.info("GoodsJob开始 start:");
		if(isSynchFlag){
			isSynchFlag=false;
			try{
				logger.info("开始执行任务");
			}catch(Exception e){
				logger.error("",e);
			}
		}
		logger.info("GoodsJob完成 end");
    	isSynchFlag = true;
    }
     
   
    
}
